package com.wing.order.model.response;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wing.cabinet.utils.ExcelExport;
import com.wing.order.model.entity.CabInventoryProductRecord;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 产品库存变动记录VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class CabInventoryProductRecordVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @ExcelExport(value = "库存变动时间", sort = 17)
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    @ExcelExport(value = "操作人", sort = 15)
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 产品库存主表id
     */
    private Long inventoryProductId;

    /**
     * 出/入库计划id
     */
    private Long planId;

    /**
     * 出/入库作业单id
     */
    private Long jobId;

    /**
     * sku id
     */
    private Long skuId;

    /**
     * skuCode
     */
    @ExcelExport(value = "物料编号", sort = 2)
    private String skuCode;

    /**
     * 仓库id
     */
    private Long warehouseId;

    /**
     * 出入库类型
     */
    private CabInventoryProductRecord.Type type;

    /**
    * 出入库类型描述
    */
    @ExcelExport(value = "库存变动方式", sort = 6)
    @TableField(exist = false)
    private String typeDesc;

    public String getTypeDesc() {
        return type == null ? null : type.getDesc();
    }

    /**
     * 出入存数量
     */
    @ExcelExport(value = "变动包装数量", sort = 9)
    private String quantity;

    /**
     * 当前库存
     */
    @ExcelExport(value = "变动前包装库存", sort = 8)
    private String quantityCurrent;

    /**
     * 变动后库存
     */
    @ExcelExport(value = "变动后包装库存", sort = 10)
    private String quantityAfter;

    /**
     * SKU名称
     */
    @ExcelExport(value = "物料名称", sort = 1)
    private String skuName;

    /**
     * 仓库
     */
    @ExcelExport(value = "仓库", sort = 4)
    private String warehouseName;

    /**
     * 老规格码
     */
    @ExcelExport(value = "规格码", sort = 3)
    private String oldSpecCode;

    /**
     * 品牌名称
     */
    private String brandName;

    /**
     * 出入库类型ID
     */
    private Long warehouseInventoryTypeId;

    /**
     * 出入库类型名称
     */
    @ExcelExport(value = "库存变动类型", sort = 7)
    private String warehouseInventoryTypeName;

    /**
     * 包装ID
     */
    private Long packId;

    /**
     * 包装方案
     */
    @ExcelExport(value = "包装方案", sort = 11)
    private String packName;

    /**
     * 变动基础数量
     */
    @ExcelExport(value = "变动基础数量", sort = 13)
    private String quantityPack;

    /**
     * 变动前基础库存
     */
    @ExcelExport(value = "变动前基础库存", sort = 12)
    private String quantityPackCurrent;

    /**
     * 变动后基础库存
     */
    @ExcelExport(value = "变动后基础库存", sort = 14)
    private String quantityPackAfter;

    /**
     * 部门名称
     */
    @ExcelExport(value = "部门", sort = 16)
    private String departmentName;

    /**
     * 供应商公司名称
     */
    @ExcelExport(value = "供应商", sort = 5)
    private String corporateName;

    /**
     * 期初数量(包装计)
     */
    private Integer openingPackQuantity;

    /**
     * 期初数量(基础单位计)
     */
    private Integer openingQuantity;

    /**
     * 总仓入库数量(包装计)
     */
    private Integer storagePackQuantity;

    /**
     * 总仓入库数量(基础单位计)
     */
    private Integer storageQuantity;

    /**
     * 领新出库数量(包装计)
     */
    private Integer outboundPackQuantity;

    /**
     * 领新出库数量(基础单位计)
     */
    private Integer outboundQuantity;

    /**
     * 结存数量(包装计)
     */
    private Integer balancePackQuantity;

    /**
     * 结存数量(基础单位计)
     */
    private Integer balanceQuantity;

    /**
     * 查询产品期初仓库集合
     */
    private String openingWarehouseIds;

    /**
     * 查询产品结存仓库集合
     */
    private String balanceWarehouseIds;

}
